package com.xuelang.pipeline.worker.entry.configmap;

import com.xuelang.pipeline.worker.app.configmap.ConfigMapService;
import com.xuelang.pipeline.worker.client.common.result.ApiResult;
import com.xuelang.pipeline.worker.client.configmap.IConfigMapService;
import com.xuelang.pipeline.worker.client.configmap.dto.ConfigMapDTO;
import io.kubernetes.client.openapi.models.V1ConfigMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuyuan.ly
 * @since 2024/7/23 11:07
 */
@RestController
@RequestMapping("/pipeline/worker/configmap")
public class ConfigMapController implements IConfigMapService {

    @Autowired
    private ConfigMapService configMapService;

    @Override
    public ApiResult<Boolean> saveOrUpdateConfigMap(ConfigMapDTO configMapDTO) {
        V1ConfigMap v1ConfigMap = configMapService.saveOrUpdateConfigMap(configMapDTO);
        return ApiResult.success(true);
    }

    @Override
    public ApiResult<Boolean> deleteConfigMap(ConfigMapDTO configMapDTO) {
        return null;
    }
}
